const express = require('express');
const router = express.Router();
const userController = require('../controllers/userController');
const { authMiddleware } = require('../middleware/auth');

// 获取所有用户
router.get('/', authMiddleware, userController.getAllUsers);

// 获取单个用户
router.get('/:id', authMiddleware, userController.getUserById);

// 创建用户
router.post('/', authMiddleware, userController.createUser);

// 更新用户
router.put('/:id', authMiddleware, userController.updateUser);

// 删除用户
router.delete('/:id', authMiddleware, userController.deleteUser);

// 重置用户密码
router.put('/:id/reset-password', authMiddleware, userController.resetPassword);

// 更新个人信息
router.put('/:id/profile', authMiddleware, userController.updateProfile);

module.exports = router; 